package com.cxb;

import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;

import java.util.Calendar;
import java.util.TimeZone;

public class TimeUtil {
    private static final String PATTERN = "MM/dd/yyyy HH:mm:ss";
    public static void main(String[] args) {

        // 下午15点20开始同步 同步的开始日期是14点00分00秒，对应法国时间为UTC+1/2 也就是 直接获取
//        DateTime dateTime = new DateTime(TimeZone.getTimeZone("Europe/Paris"));
        DateTime dateTime = DateUtil.parse("2024-01-25 01:15:00");
        dateTime = new DateTime(dateTime,TimeZone.getTimeZone("Europe/Paris"));
        dateTime = DateUtil.offsetHour(dateTime,-1);
        dateTime = DateUtil.truncate(dateTime, DateField.HOUR_OF_DAY);
        String startSyncDateStr = DateUtil.format(dateTime, PATTERN);
        System.out.println(startSyncDateStr);
    }
}
